﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/ShenBaoYBQY.master"
    AutoEventWireup="true" CodeFile="1-3.aspx.cs" Inherits="ybqy_1_3" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder3" runat="Server">
    <script language="javascript" type="text/javascript" src="../kongjian/Lodop/LodopFuncs.js"></script>
    <script language="javascript" type="text/javascript" src="../kongjian/myjs/myjs.js"></script>
    <p>
    
        <span class="BiaoBiaoTi" >表1-3 上年主要产品、原辅材料年产(用)量</span> 
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataSourceID="SqlDataSource3" CellPadding="4" DataKeyNames="id" 
            ForeColor="#333333" GridLines="None" onrowdatabound="GridView1_RowDataBound" 
            onselectedindexchanged="GridView1_SelectedIndexChanged" 
            
            Width="1041px" onrowdeleted="GridView1_RowDeleted" 
            onselectedindexchanging="GridView1_SelectedIndexChanging" onrowdeleting="GridView1_RowDeleting" 
            >
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:TemplateField Visible="False">
                    <ItemTemplate>
                        <asp:Label ID="lbhidden" runat="server" Text='<%# Eval("id") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="PRODUCT_NAME" HeaderText="1.主要产品名称" 
                    SortExpression="PRODUCT_NAME">
                <ItemStyle Width="70px" />
                </asp:BoundField>
                <asp:BoundField DataField="PRODUCT_UNIT" HeaderText="2.计量单位" 
                    SortExpression="PRODUCT_UNIT">
                <ItemStyle Width="60px" />
                </asp:BoundField>
                <asp:BoundField DataField="PLAN_COUNT" HeaderText="3.设计年产量" 
                    SortExpression="PLAN_COUNT">
                <ItemStyle Width="70px" />
                </asp:BoundField>
                <asp:BoundField DataField="PRODUCT_COUNT" HeaderText="4.年产量" 
                    SortExpression="PRODUCT_COUNT">
                <ItemStyle Width="50px" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="5.主要原辅材料名称        |2.计量单位          |6.用（耗）量">
                    <ItemTemplate>
                        <asp:GridView ID="GridView4" runat="server" AutoGenerateColumns="False" 
                            DataKeyNames="id" ShowHeader="False" Width="390px">
                            <Columns>
                                <asp:BoundField DataField="DATUM_NAME" HeaderText="DATUM_NAME" 
                                    SortExpression="DATUM_NAME" >
                                <ItemStyle Width="159px" />
                                </asp:BoundField>
                                <asp:BoundField DataField="DATUM_UNIT" HeaderText="DATUM_UNIT" 
                                    SortExpression="DATUM_UNIT" >
                                <ItemStyle Width="99px" />
                                </asp:BoundField>
                                <asp:BoundField DataField="DATUM_USE" HeaderText="DATUM_USE" 
                                    SortExpression="DATUM_USE" >
                                <ItemStyle Width="129px" />
                                </asp:BoundField>
                            </Columns>
                        </asp:GridView>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" />
                    <ItemStyle Width="400px" />
                </asp:TemplateField>
                <asp:BoundField DataField="PRODUCT_WATER" HeaderText="7.单位产品用水量" 
                    SortExpression="PRODUCT_WATER">
                <ItemStyle Width="80px" />
                </asp:BoundField>
                <asp:BoundField DataField="PRODUCT_SOURCE" HeaderText="8.单位产品能耗量" 
                    SortExpression="PRODUCT_SOURCE">
                <ItemStyle Width="70px" />
                </asp:BoundField>
                <asp:BoundField DataField="PRODUCT_COAL" HeaderText="9.其中单位产品煤耗量" 
                    SortExpression="PRODUCT_COAL">
                <ItemStyle Width="90px" />
                </asp:BoundField>
                <asp:CommandField ShowSelectButton="True" />
                <asp:CommandField ShowDeleteButton="True" />
            </Columns>
            <EditRowStyle BackColor="#2461BF" />
            <EmptyDataTemplate>
                <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
                    DataKeyNames="id" DataSourceID="SqlDataSource2">
                    <Columns>
                        <asp:BoundField DataField="DATUM_NAME" HeaderText="DATUM_NAME" 
                            SortExpression="DATUM_NAME" />
                        <asp:BoundField DataField="DATUM_UNIT" HeaderText="DATUM_UNIT" 
                            SortExpression="DATUM_UNIT" />
                        <asp:BoundField DataField="DATUM_USE" HeaderText="DATUM_USE" 
                            SortExpression="DATUM_USE" />
                    </Columns>
                </asp:GridView>
            </EmptyDataTemplate>
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F5F7FB" />
            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
            <SortedDescendingCellStyle BackColor="#E9EBEF" />
            <SortedDescendingHeaderStyle BackColor="#4870BE" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringole %>"
            ProviderName="<%$ ConnectionStrings:ConnectionStringole.ProviderName %>" 
            
            SelectCommand="SELECT qiyeid, ShenBaoNianDu, PRODUCT_ID, PRODUCT_NAME, PRODUCT_UNIT, PLAN_COUNT, PRODUCT_COUNT, TECHNICS, WATER_OUTVALUE, GAS_OUTVALUE, DANGER_COUNT, SOLID_COUNT, PRODUCT_WATER, PRODUCT_SOURCE, PRODUCT_COAL, isexport FROM a01103 WHERE (qiyeid = ?) AND (ShenBaoNianDu = ?)" 
            UpdateCommand="UPDATE a01103 SET PRODUCT_NAME = '1' ">
            <SelectParameters>
                <asp:SessionParameter Name="qiyeid" SessionField="qiyeid" Type="String" />
                <asp:SessionParameter Name="ShenBaoNianDu" SessionField="ShenBaoNianDu" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionStringole %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionStringole.ProviderName %>" 
            
            SelectCommand="SELECT [id], [PRODUCT_NAME], [PRODUCT_UNIT], [PLAN_COUNT], [PRODUCT_COUNT], [PRODUCT_WATER], [PRODUCT_SOURCE], [PRODUCT_COAL] FROM [a01103] WHERE (([qiyeid] = ?) AND ([ShenBaoNianDu] = ?)) ORDER BY [id]" 
            OldValuesParameterFormatString="original_{0}" 
            DeleteCommand="select * from A01103">
            <SelectParameters>
                <asp:SessionParameter Name="qiyeid" SessionField="qiyeid" Type="String" />
                <asp:SessionParameter Name="ShenBaoNianDu" SessionField="ShenBaoNianDu" 
                    Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:HiddenField ID="HiddenField_id" runat="server" />
        <asp:HiddenField ID="HiddenField_xiugai" runat="server" />
    </p>
    <p>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringole %>"
            ProviderName="<%$ ConnectionStrings:ConnectionStringole.ProviderName %>" 
            SelectCommand="SELECT * FROM [a01103_f] WHERE (([qiyeid] = ?) AND ([ShenBaoNianDu] = ?))">
            <SelectParameters>
                <asp:SessionParameter Name="qiyeid" SessionField="qiyeid" Type="String" />
                <asp:SessionParameter Name="ShenBaoNianDu" SessionField="ShenBaoNianDu" 
                    Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
    <table >
        <tr>
            <td style="text-align: right; width: 111px">
                1.主要产品名称</td>
            <td style="width: 170px">
                <asp:TextBox ID="PRODUCT_NAME" runat="server" onclick="gettishi('10110301')" 
                    Width="125px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="PRODUCT_NAME" ErrorMessage="必填"></asp:RequiredFieldValidator>
            </td>
            <td colspan="2" rowspan="4">
                <table  border="1px">
                    <tr>
                        <td style="width: 205px">
                            5.主要原辅材料名称</td>
                        <td style="width: 185px">
                            2.计量单位</td>
                        <td>
                            6.用（耗）量</td>
                    </tr>
                    <tr>
                        <td style="width: 205px">
                            <asp:TextBox ID="DATUM_NAME1" runat="server" onclick="gettishi('10110305')"></asp:TextBox>
                        </td>
                        <td style="width: 185px">
                            <asp:TextBox ID="DATUM_UNIT1" runat="server" onclick="gettishi('10110302')"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="DATUM_USE1" runat="server" onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false"  onclick="gettishi('10110306')"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 205px">
                            <asp:TextBox ID="DATUM_NAME2" runat="server" onclick="gettishi('10110305')"></asp:TextBox>
                        </td>
                        <td style="width: 185px">
                            <asp:TextBox ID="DATUM_UNIT2" runat="server" onclick="gettishi('10110302')"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="DATUM_USE2" runat="server" onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false"  onclick="gettishi('10110306')"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 205px">
                            <asp:TextBox ID="DATUM_NAME3" runat="server" onclick="gettishi('10110305')"></asp:TextBox>
                        </td>
                        <td style="width: 185px">
                            <asp:TextBox ID="DATUM_UNIT3" runat="server" onclick="gettishi('10110302')"></asp:TextBox>
                        </td>
                        <td>
                            <asp:TextBox ID="DATUM_USE3" runat="server" onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false"  onclick="gettishi('10110306')"></asp:TextBox>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td style="width: 111px; text-align: right">
                &nbsp;</td>
            <td style="width: 170px">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 111px; text-align: right">
                2.计量单位</td>
            <td style="width: 170px">
                <asp:TextBox ID="PRODUCT_UNIT" runat="server" onclick="gettishi('10110302')" 
                    Width="125px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ControlToValidate="PRODUCT_UNIT" ErrorMessage="必填"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td style="width: 111px; text-align: right">
                &nbsp;</td>
            <td style="width: 170px">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 111px; text-align: right">
                3.设计年产量</td>
            <td style="width: 170px">
                <asp:TextBox ID="PLAN_COUNT" runat="server" 
                    onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false" 
                    onclick="gettishi('10110303')" Width="125px" ></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                    ControlToValidate="PLAN_COUNT" ErrorMessage="必填"></asp:RequiredFieldValidator>
            </td>
            <td style="text-align: right; width: 169px">
                7.单位产品用水量(吨)</td>
            <td style="width: 252px">
                <asp:TextBox ID="PRODUCT_WATER" runat="server" onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false"  onclick="gettishi('10110307')"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td style="width: 111px">
                &nbsp;</td>
            <td style="width: 170px">
                &nbsp;</td>
            <td style="text-align: right; width: 169px">
                8.单位产品能耗量（吨标煤）</td>
            <td style="width: 252px">
                <asp:TextBox ID="PRODUCT_SOURCE" runat="server" 
                    onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false"  
                    onclick="gettishi('10110308')" ></asp:TextBox> 
            </td>
        </tr>
        <tr>
            <td style="width: 111px; text-align: right">
                4.年产量</td>
            <td style="width: 170px">
                <asp:TextBox ID="PRODUCT_COUNT" runat="server" 
                    onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false"  
                    onclick="gettishi('10110304')" Width="125px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                    ControlToValidate="PRODUCT_COUNT" ErrorMessage="必填"></asp:RequiredFieldValidator>
            </td>
            <td style="text-align: right; width: 169px">
                9.其中单位产品煤耗量(吨)</td>
            <td style="width: 252px">
                <asp:TextBox ID="PRODUCT_COAL" runat="server" onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false"  onclick="gettishi('10110309')"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td style="width: 111px">
                &nbsp;</td>
            <td style="width: 170px">
                &nbsp;</td>
            <td style="width: 169px">
                &nbsp;</td>
            <td style="width: 252px">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 111px">
                &nbsp;</td>
            <td style="width: 170px; text-align: right">
                &nbsp;</td>
            <td style="width: 169px">
                <asp:Button ID="Button1" runat="server" style="text-align: right" 
                    Text="提交" onclick="Button1_Click" />
                <asp:Label ID="Label3" runat="server"></asp:Label>
            </td>
            <td style="width: 252px">
                <input id="Button5" type="button" onclick="PrintOneURL('print/1-3.aspx')" value="打印本页" />
            </td>
        </tr>
    </table>
    <p>
        <table>
        <tr>
            <td style="width: 456px">
                <textarea id="TextArea1" name="S1" rows="3" style="width: 430px; height: 45px" 
                    readonly="readonly"></textarea>
            </td>
            <td>
                <textarea id="TextArea2" name="S2" style="width: 430px; height: 45px; font-size: xx-large;
                    color: #FF0000; font-weight: 700;" cols="20"></textarea>
            </td>
        </tr>
        <tr>
            <td style="width: 456px">
                <textarea id="TextArea3" name="S3" rows="3" style="width: 430px; height: 45px" 
                    cols="20" readonly="readonly"></textarea>
            </td>
            <td>
                <asp:TextBox ID="TextBox99" runat="server" Height="45px" TextMode="MultiLine" 
                    Width="430px" ReadOnly="True"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td style="width: 456px; height: 144px;">
            </td>
            <td style="height: 144px">
            </td>
        </tr>
    </table>
    <input id="Text100" style="visibility: hidden" type="text" value="<%=DisplayStr()%>"
        disabled="disabled" />
    <script type="text/javascript">
        function gettishi(str) {
            var str2 = document.getElementById("Text100").value;
            str2.replace(/\'/g, "\"");
            //取得文本框的值
            var arr = eval(str2);
            document.getElementById("TextArea1").value = '';
            document.getElementById("TextArea2").value = '';
            document.getElementById("TextArea3").value = '';


            for (var i = 0; i < arr.length; i++) {
                if (arr[i].tishiid == str) {
                    if (arr[i].ti1.length > 0) {
                        document.getElementById("TextArea1").value = arr[i].idmingcheng + "填写说明:  " + arr[i].ti1;
                    }
                    if (arr[i].ti2.length > 0) {
                        document.getElementById("TextArea2").value = arr[i].ti2;
                    }
                    if (arr[i].ti3.length > 0) {
                        document.getElementById("TextArea3").value = arr[i].idmingcheng + "填写例子:  " + arr[i].ti3;
                    }
                }
            }



        }
    </script>

    </p>
    <p>
    </p>
</asp:Content>
